Strict

Import agfx

Global myTmpScreen:TTmpScreen

Class TAgfx_test_app Extends TFramework

	Method OnCreate:Int()
		
		'DEVICE.SetFps(30)		' default FPS is 60

		Super.OnCreate()


		'DISPLAY.SetVirtualSize(320,480)

		Self.fps_On = True
		myTmpScreen = New TTmpScreen		
		myTmpScreen.Prepare()
		
		Return 0
	End
	
End

Class myTGestureRecorder Extends TGestureRecorder

	Method OnRelease:Void()
		Print("Gesture done [length="+Self.length+"]")	
		Print("Speed: "+Self.GetSpeed())
		Print("Time: "+Self.GetTime())
	End Method

End Class
Class TTmpScreen Extends TScreen
	
	Field path:myTGestureRecorder
	Field txt:String = "GM_LINE"
	
	
	Method Start:Void()
		Self.path = New myTGestureRecorder	
		Self.path.draw_on=True
		Self.path.mode=GM_LINE
		
	End
	
	' main app logic loop update
	Method Update:Void()
		Self.path.Update()

		If KeyHit(KEY_1) Then
			Self.path.mode = GM_LINE
			Self.txt = "GM_LINE"
		End

		If KeyHit(KEY_2) Then		
			Self.path.mode = GM_LINES	
			Self.txt = "GM_LINES"
		End
		
		
		If KeyHit(KEY_3) Then
			Self.path.mode = GM_SPLINES
			Self.txt = "GM_SPLINES"
		End
		
	End
	
	' main app render loop
	Method Render:Void()
		Cls
		Self.path.Render()

		DrawText("[1] GM_LINE",0,20)
		DrawText("[2] GM_LINES",0,40)
		DrawText("[3] GM_SPLINES",0,60)

		DrawText(txt,0,80)
		
	End
End



